/*
 * @Author: your name
 * @Date: 2022-03-04 15:21:09
 * @LastEditTime: 2022-03-04 15:40:01
 * @LastEditors: your name
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: /car_lrp_plugin/lib/car_lrp_plugin.dart
 */
import 'dart:async';

import 'package:car_lrp_plugin/car_info.dart';
import 'package:flutter/services.dart';

class CarLrpPlugin {
  static const MethodChannel _channel = MethodChannel('car_lrp_plugin');

  static Future<String?> get platformVersion async {
    final String? version = await _channel.invokeMethod('getPlatformVersion');
    return version;
  }

  static Future<CarInfo?> openScan({bool needApply = true}) async {
    var options = {"needApply": needApply};
    var code = await _channel.invokeMethod('openScan', options);
    print("code==>${code['code']}");
    return CarInfo.fromMap(code);
  }
}
